var toggleFlag = 0;
var movieHeight;
var movTime;
var endTime;
var startTime;


var movPlaying = true;

function InsertMovie()
	{

		document.write('<embed SRC="http://itp.nyu.edu/~ss4259/karaoke/assets/bizarrel.kar"\n');
		document.write('HEIGHT="220" WIDTH="300"\n'); //each dimention reduced by 20 px.  240 . 320 
		document.write('TYPE="video/quicktime"\n');
		document.write('PLUGINSPAGE="http://www.apple.com/quicktime/download/"\n');
		document.write('name="ktest"\n');
		document.write('enablejavascript="true"\n');
		document.write('autoplay="true"\n');	
		document.write('</>\n');
	}


function playOption() 
{
document.ktest.SetAutoPlay(false);
}



function qtStatus()
	{
//	console.log("loaded aalsd  bitches");
	//var num =  document.ktest.GetRectangle().substring(9,12);
	//console.log(num);
	
	endTime = document.ktest.GetEndTime();
	startTime = document.ktest.GetStartTime();

	console.log(document.ktest.GetTime());

	 if (document.ktest.GetTime() == endTime)
		{
			movPlaying = false;
			//console.log(movPlaying);

		}
	}




// not used at the moment. used to try and resize our qt movie.
function movieSize()

	{
	
	var  movieHeight = document.ktest.GetRectangle().substring(9,12);
	
	document.write('<embed SRC="http://itp.nyu.edu/~ss4259/karaoke/assets/bizzarel.kar"\n');
	document.write('HEIGHT= movieHeight WIDTH="300"\n'); //each dimention reduced by 20 px.  240 . 320 
	document.write('TYPE="video/quicktime"\n');
	document.write('PLUGINSPAGE="http://www.apple.com/quicktime/download/"\n');
	document.write('name="ktest"\n');
	document.write('enablejavascript="true"\n');
	document.write('<onload="qtStatus"/>\n');
	
	}

/*

function setSize1(anObj)
	{
	movieHeight = document.anObj.GetRectangle().substring(9,12);
	console.log(movieHeight);
	}

*/


function onOff(anObj)
{
	if (toggleFlag == 0) {
		
		anObj.Play();
		toggleFlag = 1;
		console.log(toggleFlag);
	
	}
	else {
		anObj.Stop();
 		toggleFlag = 0;
		console.log(toggleFlag);
	}
}

/*

function PlayIt(anObj)

         {
                 anObj.Play();
		console.log("hit");
         }

function StopIt(anObj)

         {
                 anObj.Stop();
         }

*/





